﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace CodeAuto.DALS
{
    public class AssemblyDAL
    {
        public static string GetAssemblyFile(int projectId, string projectName, string projectDescription, int pageType)
        {
            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            sb.AppendLine("using System.Reflection;");
            sb.AppendLine("using System.Runtime.CompilerServices;");
            sb.AppendLine("using System.Runtime.InteropServices;");
            sb.AppendLine("// 有关程序集的常规信息通过以下特性集 ");
            sb.AppendLine("// 控制。更改这些特性值可修改");
            sb.AppendLine("// 与程序集关联的信息。");
            sb.AppendLine("[assembly: AssemblyTitle(\"" + projectName + "\")]");
            sb.AppendLine("[assembly: AssemblyDescription(\"" + projectDescription + "\")]");
            sb.AppendLine("[assembly: AssemblyConfiguration(\"\")]");
            sb.AppendLine("[assembly: AssemblyCompany(\"大卫代码生成器\")]");
            sb.AppendLine("[assembly: AssemblyProduct(\"" + projectName + "\")]");
            sb.AppendLine("[assembly: AssemblyCopyright(\"Copyright © 大卫代码生成器 " + DateTime.Now.Year + "\")]");
            sb.AppendLine("[assembly: AssemblyTrademark(\"\")]");
            sb.AppendLine("[assembly: AssemblyCulture(\"\")]");
            sb.AppendLine("// 将 ComVisible 设置为 false 会使此程序集中的类型 ");
            sb.AppendLine("// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型， ");
            sb.AppendLine("// 则将该类型上的 ComVisible 特性设置为 true。");
            sb.AppendLine("[assembly: ComVisible(false)]");
            //sb.AppendLine("// 如果此项目向 COM 公开，则下列 GUID 用于类型库的 ID");
            //sb.AppendLine("[assembly: Guid(\"eb81482e-0791-4dda-" + CsprojDALS.GetPartString(projectId, pageType, 4) + "-" + CsprojDALS.GetPartString(projectId, pageType, 12) + "\")]");
            sb.AppendLine("");
            sb.AppendLine("[assembly: AssemblyVersion(\"1.0.0.0\")]");
            sb.AppendLine("[assembly: AssemblyFileVersion(\"1.0.0.0\")]");
            return sb.ToString();
        }
    }
}